package com.xszx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xszx.entity.TMeneu;
import com.xszx.service.TMeneuService;
import com.xszx.mapper.TMeneuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 34129
* @description 针对表【t_meneu】的数据库操作Service实现
* @createDate 2024-01-08 20:40:47
*/
@Service
public class TMeneuServiceImpl extends ServiceImpl<TMeneuMapper, TMeneu>
    implements TMeneuService{

    @Autowired
    private TMeneuMapper meneuMapper;

    @Override
    public TMeneu getMenuByName(String mname) {
        return meneuMapper.getMenuByName(mname);
    }

    @Override
    public TMeneu selectMenuList(long mid) {
        return meneuMapper.selectMenuList(mid);
    }

    @Override
    public int insertMenus(TMeneu tMeneu) {
        return meneuMapper.insertMenus(tMeneu);
    }

    @Override
    public int deleteMenus(long mid) {
        return meneuMapper.deleteMenus(mid);
    }

    @Override
    public int updateMenus(TMeneu meneu) {

        int i = meneuMapper.updateById(meneu);

        if(i>0){
            return 1;
        }
        return 0;
    }

    @Override
    public List<TMeneu> selectMenus() {
       List<TMeneu> meneus =  meneuMapper.selectMenus();
        return meneus;
    }
}




